import request from '@/config/axios'

export interface DocsVO {
        id: number
        groupId: number
        name: string
        sceneCode: string
        content: string
        sort: number
}

// 查询知识库文档列表
export const getDocsPage = async (params) => {
    return await request.get({url: `/system/docs/page`, params})
}

// 查询知识库文档详情
export const getDocs = async (id: number) => {
    return await request.get({url: `/system/docs/get?id=` + id})
}

// 新增知识库文档
export const createDocs = async (data: DocsVO) => {
    return await request.post({url: `/system/docs/create`, data})
}

// 修改知识库文档
export const updateDocs = async (data: DocsVO) => {
    return await request.put({url: `/system/docs/update`, data})
}

// 删除知识库文档
export const deleteDocs = async (id: number) => {
    return await request.delete({url: `/system/docs/delete?id=` + id})
}

// 导出知识库文档 Excel
export const exportDocs = async (params) => {
    return await request.download({url: `/system/docs/export-excel`, params})
}
